package com.central.apps.handler;

import java.util.List;
import java.util.Map;

import com.central.apps.handler.base.LvBaseHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.central.apps.service.TestService;
import com.central.common.auth.details.LoginAppUser;
import com.central.common.util.SysUserUtil;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class DocMailHandler extends LvBaseHandler {

	@Autowired
	TestService TestService;
	
	/**
	 * 处理类：保存后调用(会在主表和子表保存后都调用)
	 *
	 * @param app     应用
	 * @param objName 表名
	 * @param data    数据
	*/
	public void afterSave(String app, String objName, Map<String, Object> data, boolean isUpdate) throws Exception {
		List<Map<String,Object>> findFirstApp = TestService.findFirstApp();
		log.info("----------------------------------------------findFirstApp:"+JSONObject.toJSONString(findFirstApp));
	}

    public  void beforSave(java.lang.String app, java.lang.String objName, java.util.Map<java.lang.String,java.lang.Object> data, boolean isUpdate) throws java.lang.Exception {
        LoginAppUser user = SysUserUtil.getLoginAppUser();
        data.put("updateuserdesc", user.getNickname());
    }
    

}
